#include "mylineedit.h"
#include <QKeyEvent>
#include <QDebug>
//#include<QLineEdit>
MyLineEdit::MyLineEdit(QWidget *parent)
    : QLineEdit{parent}
{

}
void MyLineEdit::keyPressEvent(QKeyEvent *event)
{
    qDebug()<<tr("this is MyLinEdit");
    QLineEdit::keyPressEvent(event);
    event->ignore();
}

bool MyLineEdit::event(QEvent *event)
{
    if (event->type()==QEvent::KeyPress)
        qDebug()<<tr("MyLineEdit的event函数");
    return QLineEdit::event(event);
}
